package com.kt.thread.demo.model;

/**
 * @Description:
 * @Author: kt
 * @CreateTime: 2021/3/13
 */
public class Client{
    private Server server;
    private String name;

    public Client(String name, Server server) {
        this.name = name;
        this.server = server;
    }

    public void send(AbstractCommand command) {
        System.out.println("客户端:" + name + "向服务端发送数据");
        server.send(new ClientTask(this,command));
    }

    public void recv(String data) {
        System.out.println("客户端:" + name + "接收到服务端返回数据:" + data);
    }
}
